<!DOCTYPE html>
<html>
<head>
	<!-- Global site tag (gtag.js) - Google Analytics -->
	<script async src="https://www.googletagmanager.com/gtag/js?id='UA-133422980-2"></script>
	<script>
	  window.dataLayer = window.dataLayer || [];
	  function gtag(){dataLayer.push(arguments);}
	  gtag('js', new Date());

	  gtag('config', 'UA-133422980-2');
	</script>

	<meta charset="utf-8">
	<meta http-equiv="x-ua-compatible" content="ie=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">

	<title>
		gem5: Debugger-based Debugging 
	</title>

	<!-- SITE FAVICON -->
	<link rel="shortcut icon" type="image/gif" href="/assets/img/gem5ColorVert.gif"/>

	<link rel="canonical" href="http://localhost:4000/documentation/general_docs/debugging_and_testing/debugging/debugger_based_debugging">
	<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,700,800,600' rel='stylesheet' type='text/css'>
	<link href='https://fonts.googleapis.com/css?family=Muli:400,300' rel='stylesheet' type='text/css'>

	<!-- FAVICON -->
	<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">

	<!-- BOOTSTRAP -->
	<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">

	<!-- CUSTOM CSS -->
	<link rel="stylesheet" href="/css/main.css">
</head>


<body>
	<nav class="navbar navbar-expand-md navbar-light bg-light">
  <a class="navbar-brand" href="/">
		<img src="/assets/img/gem5ColorLong.gif" alt="gem5" height=55px>
	</a>
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>
  <div class="collapse navbar-collapse" id="navbarNavDropdown">
    <!-- LIST FOR NAVBAR -->
    <ul class="navbar-nav ml-auto">
      <!-- HOME -->
      <li class="nav-item ">
        <a class="nav-link" href="/">Home</a>
      </li>

      <!-- ABOUT -->
			<li class="nav-item dropdown ">
				<a class="nav-link dropdown-toggle" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
					About
				</a>
				<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
          <a class="dropdown-item" href="/about">About gem5</a>
          <a class="dropdown-item" href="/publications">Publications</a>
          <a class="dropdown-item" href="/governance">Governance</a>
				</div>
			</li>

      <!-- DOCUMENTATION -->
			<li class="nav-item dropdown active">
				<a class="nav-link dropdown-toggle" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
					Documentation
				</a>
				<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
					<!-- Pull navigation from _data/documentation.yml -->
					
            <a class="dropdown-item" href="/documentation">gem5 documentation</a>
					
            <a class="dropdown-item" href="/documentation/learning_gem5/introduction">Learning gem5</a>
					
            <a class="dropdown-item" href="http://doxygen.gem5.org/release/current/index.html">gem5 Doxygen</a>
					
            <a class="dropdown-item" href="/documentation/reporting_problems">Reporting Problems</a>
					
				</div>
			</li>

      <!-- EVENTS -->
			<li class="nav-item dropdown ">
        <a class="nav-link" href="/events/">Events</a>
			</li>

      <!-- CONTRIBUTING -->
      <li class="nav-item ">
        <a class="nav-link" href="/contributing">Contributing</a>
      </li>

      <!-- BLOG -->
      <li class="nav-item ">
        <a class="nav-link" href="/blog">Blog</a>
      </li>

      <!-- SEARCH -->
			<li class="nav-item ">
        <a class="nav-link" href="/search">Search</a>
      </li>
    </ul>
  </div>
</nav>

	<main>
		<div class="sidenav-top">
  <div class="sidenav-brand bg-light">
    <a href="/"><img src="/assets/img/gem5ColorLong.gif" height="55px"></a>
  </div>
  <div class="search">
    <form action="/search" method="get">
      <!-- <label for="search-box"><i class="fa fa-search"></i></label> -->
      <input type="text" name="query">
      <button type="submit" name="submit"><i class="fa fa-search"></i></button>
    </form>
  </div>
</div>
<div class="sidenav">
  <!-- Pull navigation from _data/documentation.yml -->
  
    
    
      <a class="item" href="/documentation" role="button" aria-expanded="false" aria-controls="collapseExample">
        gem5 documentation
      </a>
      <div class="collapse " id="gem5_documentation">
        
      </div>
    
      <a class="item" href="/documentation/general_docs/development/coding_style/" role="button" aria-expanded="false" aria-controls="collapseExample">
        Code Style
      </a>
      <div class="collapse " id="code_style">
        
      </div>
    
      <a class="item" data-toggle="collapse" href="#building" role="button" aria-expanded="false" aria-controls="collapseExample">
        Building
      </a>
      <div class="collapse " id="building">
        
          <a class="subitem " href="/documentation/general_docs/building">Building</a>
        
          <a class="subitem " href="/documentation/general_docs/building/EXTRAS">Building EXTRAS</a>
        
      </div>
    
      <a class="item" data-toggle="collapse" href="#doxygen-docs" role="button" aria-expanded="false" aria-controls="collapseExample">
        Doxygen
      </a>
      <div class="collapse " id="doxygen-docs">
        
          <a class="subitem " href="http://doxygen.gem5.org/develop/index.html">Develop Branch</a>
        
          <a class="subitem " href="http://doxygen.gem5.org/release/v19-0-0-0/index.html">v19.0.0.0</a>
        
      </div>
    
      <a class="item" data-toggle="collapse" href="#fullsystem" role="button" aria-expanded="false" aria-controls="collapseExample">
        Full System
      </a>
      <div class="collapse " id="fullsystem">
        
          <a class="subitem " href="/documentation/general_docs/fullsystem/disks">Creating Disk Images</a>
        
          <a class="subitem " href="/documentation/general_docs/fullsystem/devices">Devices</a>
        
          <a class="subitem " href="/documentation/general_docs/fullsystem/m5term">m5term</a>
        
          <a class="subitem " href="/documentation/general_docs/fullsystem/building_arm_kernel">Building Linux ARM Kernel</a>
        
          <a class="subitem " href="/documentation/general_docs/fullsystem/building_android_m">Building Android Marshmallow</a>
        
          <a class="subitem " href="/documentation/general_docs/fullsystem/guest_binaries">Guest binaries</a>
        
      </div>
    
      <a class="item" data-toggle="collapse" href="#memory_system" role="button" aria-expanded="false" aria-controls="collapseExample">
        Memory System
      </a>
      <div class="collapse " id="memory_system">
        
          <a class="subitem " href="/documentation/general_docs/memory_system/">Memory System</a>
        
          <a class="subitem " href="/documentation/general_docs/memory_system/gem5_memory_system">gem5 Memory System</a>
        
          <a class="subitem " href="/documentation/general_docs/memory_system/replacement_policies">Replacement Policies</a>
        
          <a class="subitem " href="/documentation/general_docs/memory_system/indexing_policies">Indexing Policies</a>
        
          <a class="subitem " href="/documentation/general_docs/memory_system/classic-coherence-protocol">Classic memory system coherence</a>
        
          <a class="subitem " href="/documentation/general_docs/memory_system/classic_caches">Classic caches</a>
        
      </div>
    
      <a class="item" data-toggle="collapse" href="#ruby" role="button" aria-expanded="false" aria-controls="collapseExample">
        Ruby Memory System
      </a>
      <div class="collapse " id="ruby">
        
          <a class="subitem " href="/documentation/general_docs/ruby">Ruby</a>
        
          <a class="subitem " href="/documentation/general_docs/ruby/cache-coherence-protocols">Cache Coherence Protocols</a>
        
          <a class="subitem " href="/documentation/general_docs/ruby/garnet-2">Garnet 2.0</a>
        
          <a class="subitem " href="/documentation/general_docs/ruby/MOESI_CMP_directory">MOESI CMP directory</a>
        
          <a class="subitem " href="/documentation/general_docs/ruby/garnet_synthetic_traffic">Garnet Synthetic Traffic</a>
        
          <a class="subitem " href="/documentation/general_docs/ruby/slicc">SLICC</a>
        
          <a class="subitem " href="/documentation/general_docs/ruby/MI_example">MI example</a>
        
          <a class="subitem " href="/documentation/general_docs/ruby/Garnet_standalone">Garnet standalone</a>
        
          <a class="subitem " href="/documentation/general_docs/ruby/interconnection-network">Interconnection network</a>
        
          <a class="subitem " href="/documentation/general_docs/ruby/MOESI_hammer">MOESI hammer</a>
        
          <a class="subitem " href="/documentation/general_docs/ruby/MOESI_CMP_token">MOESI CMP token</a>
        
          <a class="subitem " href="/documentation/general_docs/ruby/MESI_Two_Level">MESI two level</a>
        
          <a class="subitem " href="/documentation/general_docs/memory_system/replacement_policies">Replacement Policies</a>
        
      </div>
    
      <a class="item" data-toggle="collapse" href="#cpu_models" role="button" aria-expanded="false" aria-controls="collapseExample">
        CPU Models
      </a>
      <div class="collapse " id="cpu_models">
        
          <a class="subitem " href="/documentation/general_docs/cpu_models/SimpleCPU">SimpleCPU</a>
        
          <a class="subitem " href="/documentation/general_docs/cpu_models/O3CPU">O3CPU</a>
        
          <a class="subitem " href="/documentation/general_docs/cpu_models/TraceCPU">TraceCPU</a>
        
          <a class="subitem " href="/documentation/general_docs/cpu_models/minor_cpu">Minor CPU Model</a>
        
          <a class="subitem " href="/documentation/general_docs/cpu_models/execution_basics">Execution Basics</a>
        
          <a class="subitem " href="/documentation/general_docs/cpu_models/visualization">Visualization</a>
        
      </div>
    
      <a class="item" href="/documentation/general_docs/m5ops" role="button" aria-expanded="false" aria-controls="collapseExample">
        M5ops
      </a>
      <div class="collapse " id="m5ops">
        
      </div>
    
      <a class="item" href="/documentation/general_docs/checkpoints" role="button" aria-expanded="false" aria-controls="collapseExample">
        Checkpoints
      </a>
      <div class="collapse " id="checkpoints">
        
      </div>
    
      <a class="item" data-toggle="collapse" href="#directed_testers" role="button" aria-expanded="false" aria-controls="collapseExample">
        Directed Testers
      </a>
      <div class="collapse " id="directed_testers">
        
          <a class="subitem " href="/documentation/general_docs/debugging_and_testing/directed_testers/garnet_synthetic_traffic">Garnet Synthetic Traffic</a>
        
          <a class="subitem " href="/documentation/general_docs/debugging_and_testing/directed_testers/ruby_random_tester">Ruby Random Tester</a>
        
      </div>
    
      <a class="item" data-toggle="collapse" href="#debugging" role="button" aria-expanded="false" aria-controls="collapseExample">
        Debugging
      </a>
      <div class="collapse show" id="debugging">
        
          <a class="subitem " href="/documentation/general_docs/debugging_and_testing/debugging/trace_based_debugging">Trace-based Debugging</a>
        
          <a class="subitem active" href="/documentation/general_docs/debugging_and_testing/debugging/debugger_based_debugging">Debugger-based Debugging</a>
        
          <a class="subitem " href="/documentation/general_docs/debugging_and_testing/debugging/debugging_simulated_code">Debugging Simulated Code</a>
        
          <a class="subitem " href="/documentation/reporting_problems">Reporting Problems</a>
        
      </div>
    
      <a class="item" data-toggle="collapse" href="#architecture_support" role="button" aria-expanded="false" aria-controls="collapseExample">
        Architecture Support
      </a>
      <div class="collapse " id="architecture_support">
        
          <a class="subitem " href="/documentation/general_docs/architecture_support/">Architecture Support</a>
        
          <a class="subitem " href="/documentation/general_docs/architecture_support/arm_implementation/">ARM Implementation</a>
        
          <a class="subitem " href="/documentation/general_docs/architecture_support/isa_parser/">ISA Parser</a>
        
          <a class="subitem " href="/documentation/general_docs/architecture_support/x86_microop_isa/">X86 microop ISA</a>
        
      </div>
    
      <a class="item" href="/documentation/general_docs/thermal_model" role="button" aria-expanded="false" aria-controls="collapseExample">
        Power and Thermal Model
      </a>
      <div class="collapse " id="">
        
      </div>
    
      <a class="item" href="/documentation/general_docs/compiling_workloads/" role="button" aria-expanded="false" aria-controls="collapseExample">
        Compiling Workloads
      </a>
      <div class="collapse " id="compiling_workloads">
        
      </div>
    
      <a class="item" href="/documentation/general_docs/statistics/" role="button" aria-expanded="false" aria-controls="collapseExample">
        Stats Package
      </a>
      <div class="collapse " id="statistics">
        
      </div>
    
    
  
    
  
    
  
    
  
</div>


<div class="container" id="doc-container">
  <div class="edit"><a href="https://gem5.googlesource.com/public/gem5-website/+/refs/heads/master/README.md">Edit this page</a></div>
  <b>authors:</b> Bobby R. Bruce<br>
  

  <br>
  <h1 id="debugger-based-debugging">Debugger-based Debugging</h1>

<p>If traces alone are not sufficient, you’ll need to inspect what gem5 is doing
in detail using a debugger (e.g., gdb). You definitely want to use the
<code class="highlighter-rouge">gem5.debug</code> binary if you reach this point. Ideally, looking at traces should
at least allow you to narrow down the range of cycles in which you think
something is going wrong. The fastest way to reach that point is to use a
<code class="highlighter-rouge">DebugEvent</code>, which goes on gem5’s event queue and forces entry into the
debugger when the specified cycle is reached by sending the process a <code class="highlighter-rouge">SIGTRAP</code>
signal. You’ll need to to start gem5 under the debugger or have the debugger
attached to the gem5 process for this to work.</p>

<p>You can create one or more DebugEvents when you invoke gem5 using the
<code class="highlighter-rouge">--debug-break=100</code> parameter. You can also create new DebugEvents from the
debugger prompt using the <code class="highlighter-rouge">schedBreak()</code> function. The following example
session illustrates both of these approaches:</p>

<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>% gdb m5/build/ALPHA/gem5.debug
GNU gdb 6.1
Copyright 2002 Free Software Foundation, Inc.
[...]
(gdb) run --debug-break=2000 configs/run.py
Starting program: /z/stever/bk/m5/build/ALPHA/gem5.debug --debug-break=2000 configs/run.py
M5 Simulator System
[...]
warn: Entering event queue @ 0.  Starting simulation...

Program received signal SIGTRAP, Trace/breakpoint trap.
0xffffe002 in ?? ()
(gdb) p curTick
$1 = 2000
(gdb) c
Continuing.

(gdb) call schedBreak(3000)
(gdb) c
Continuing.

Program received signal SIGTRAP, Trace/breakpoint trap.
0xffffe002 in ?? ()
(gdb) p _curTick
$3 = 3000
(gdb)
</code></pre></div></div>

<p>gem5 includes a number of functions specifically intended to be called from the
debugger (e.g., using the gdb <code class="highlighter-rouge">call</code> command, as in the <code class="highlighter-rouge">schedBreak()</code> example
above). Many of these are “dump” functions which display internal simulator
data structures. For example, <code class="highlighter-rouge">eventq_dump()</code> displays the events scheduled on
the main event queue. Most of the other dump functions are associated with
particular objects, such as the instruction queue and the ROB in the detailed
CPU model. These include:</p>

<table>
  <thead>
    <tr>
      <th style="text-align: left">Function</th>
      <th style="text-align: left">Effect</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td style="text-align: left"><code class="highlighter-rouge">schedBreak(&lt;tick&gt;)</code></td>
      <td style="text-align: left">Schedule a <code class="highlighter-rouge">SIGTRAP</code> to occur at <code class="highlighter-rouge">&lt;tick&gt;</code></td>
    </tr>
    <tr>
      <td style="text-align: left"><code class="highlighter-rouge">setDebugFlag("&lt;flag&gt;")</code></td>
      <td style="text-align: left">Enable a debug flag from the debugger</td>
    </tr>
    <tr>
      <td style="text-align: left"><code class="highlighter-rouge">clearDebugFlag("&lt;flag&gt;")</code></td>
      <td style="text-align: left">Disable a debug flags from the debugger</td>
    </tr>
    <tr>
      <td style="text-align: left"><code class="highlighter-rouge">eventqDump()</code></td>
      <td style="text-align: left">Print out all events on the event queue</td>
    </tr>
    <tr>
      <td style="text-align: left"><code class="highlighter-rouge">takeCheckpoint(&lt;tick&gt;)</code></td>
      <td style="text-align: left">Create a checkpoint at cycle <code class="highlighter-rouge">&lt;tick&gt;</code></td>
    </tr>
    <tr>
      <td style="text-align: left"><code class="highlighter-rouge">SimObject::find("system.qualified.name")</code></td>
      <td style="text-align: left">Returns the pointer to the object with the specified name</td>
    </tr>
  </tbody>
</table>

<!---
The following has been commented out as the link the classic
memory system has yet to be migrated over to the website.

Additional gdb-accessible features for debugging coherence protocols in the
classic memory system are documented [here]{
http://gem5.org/Classic_Memory_System#Debugging}.
-->

<h2 id="debugging-python-with-pdb">Debugging Python with PDB</h2>

<p>You can debug configuration scripts with the <a href="https://docs.python.org/3/library/pdb.html">Python debug (PDB)</a> just as you would other Python
scripts. You can enter PDB before your configuration script is executed by
giving the <code class="highlighter-rouge">--pdb</code> argument to the gem5 binary. Another approach is to put the
following line in your configuration script (e.g., <code class="highlighter-rouge">fs.py</code> or <code class="highlighter-rouge">se.py</code>) wherever
you would like to enter the debugger:</p>

<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>import pdb; pdb.set_trace()
</code></pre></div></div>

<p>Note that the Python files under <code class="highlighter-rouge">src</code> are compiled in to the gem5 binary, so you
must rebuild the binary if you add this line (or make other changes) in these
files. Alternatively, you can set the <code class="highlighter-rouge">M5_OVERRIDE_PY_SOURCE</code> environment
variable to “true” (see <code class="highlighter-rouge">src/python/importer.py</code>).</p>

<p>See the <a href="https://docs.python.org/3/library/pdb.html">official PDB documentation</a> for more details on using PDB.</p>

<h2 id="using-valgrind">Using Valgrind</h2>

<p>Valgrind is a dynamic analysis tool used (primarily) to profile a target
application and detect the source of run-time errors, as well as detect memory
leaks.</p>

<p>For Valgrind to function, the target gem5 binary must have been compiled to
include debugging information. Therefore, the <code class="highlighter-rouge">gem5.debug</code> binaries must be
used.</p>

<p>To run a check using Valgrind, execute the following:</p>

<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>valgrind --leak-check=yes --suppressions=util/valgrind-suppressions build/{Target ISA}/gem5.debug {gem5 arguments}
</code></pre></div></div>

<p>The above will run the gem5 and do two things:</p>

<ol>
  <li>Give a stack trace if a run-time error is received.</li>
  <li>Give information about potential memory leaks.</li>
</ol>

<p>The <code class="highlighter-rouge">util/valgrind-suppressions</code> file contains a set of warnings that are
reported by Valgrind but are not considered a problem by gem5 developers.
<strong>Valgrind is known to provide false positives. <code class="highlighter-rouge">util/valgrind-suppressions</code>
should be updated as these false positives are revealed</strong>. More information
about suppressing Valgrind warnings can be found in the <a href="http://valgrind.org/docs/manual/manual-core.html#manual-core.suppress">Valgrind User Manual</a>.</p>

<p>If a run-time error is received, Valgrind will return an output which looks like
the following (taken from the <a href="http://valgrind.org/docs/manual/quick-start.html">Valgrind Quick Start Guide</a>):</p>

<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>==19182== Invalid write of size 4
==19182==    at 0x804838F: f (example.c:6)
==19182==    by 0x80483AB: main (example.c:11)
</code></pre></div></div>

<p>In this output:</p>

<ul>
  <li>19182 is the process ID</li>
  <li><code class="highlighter-rouge">Invalid write</code> is what kind of error.</li>
  <li>Below this error is the stack trace. In this example the leak occurred at
line 6 in <code class="highlighter-rouge">example.c</code>. This line is contained within function <code class="highlighter-rouge">f</code> which was
called by the <code class="highlighter-rouge">main</code> method at line 11 (also in <code class="highlighter-rouge">example.c</code>).</li>
  <li><code class="highlighter-rouge">0x804838F</code> is the code address. This is usually not important.</li>
</ul>

<p>Valgrind may also return warnings about memory leaks, such as:</p>

<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>==19182== 40 bytes in 1 blocks are definitely lost in loss record 1 of 1
==19182==    at 0x1B8FF5CD: malloc (vg_replace_malloc.c:130)
==19182==    by 0x8048385: f (a.c:5)
==19182==    by 0x80483AB: main (a.c:11)
</code></pre></div></div>

<p>The stack trace will tell you where the memory leak occurred. If Valgrind
states that a block of memory was “definitely lost” then there is a memory
leak. However, if Valgrind states that a block was “probably lost”, Valgrind
has reason to believe memory is leaking but perhaps not (this is normally if
the code is doing something complex with pointers).</p>

<p>If Valgrind returns an output in which a root cause is difficult to determine,
try running Valgrind with <code class="highlighter-rouge">--track-origins=yes</code>. This will increase execution
time but will provide more information.</p>

<p>The <a href="https://valgrind.org/docs/manual/manual.html">Valgrind User Manual</a> should
be consulted for more advanced features.</p>

  <br>

  <!-- RETRIVE PREVIOUS PAGE LINK -->
  
    
  
    
  
    
  
    
  

  <!-- RETRIEVE NEXT PAGE LINK -->
  
    
  
    
  
    
  
    
  


  <div class="navbuttons">
    
      <a href=""><button type="button" class="btn btn-outline-primary">PREVIOUS</button></a>
    

    
      <a href=""><button type="button" class="btn btn-outline-primary">NEXT</button></a>
    
  </div>
</div>

	</main>
	<footer class="page-footer">
	<div class="container">
		<div class="row">

			<div class="col-12 col-sm-4">
				<p>gem5</p>
				<p><a href="/about">About</a></p>
				<p><a href="/publications">Publications</a></p>
				<p><a href="/contributing">Contributing</a></p>
				<p><a href="/governance">Governance</a></p>
			<br></div>

			<div class="col-12 col-sm-4">
				<p>Docs</p>
				<p><a href="/documentation">Documentation</a></p>
				<p><a href="http://gem5.org/Documentation">Old Documentation</a></p>
				<p><a href="https://gem5.googlesource.com/public/gem5">Source</a></p>
			<br></div>

			<div class="col-12 col-sm-4">
				<p>Help</p>
				<p><a href="/search">Search</a></p>
				<p><a href="/mailing_lists">Mailing Lists</a></p>
				<p><a href="https://gem5.googlesource.com/public/gem5-website/+/refs/heads/master/README.md">Website Source</a></p>
			<br></div>

		</div>
	</div>
</footer>


	<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
	<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
	<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
	<script src="https://unpkg.com/commentbox.io/dist/commentBox.min.js"></script>

	<script>
	  // When the user scrolls down 20px from the top of the document, show the button
	  window.onscroll = function() {scrollFunction()};

	  function scrollFunction() {
	      if (document.body.scrollTop > 100 || document.documentElement.scrollTop > 20) {
	          document.getElementById("myBtn").style.display = "block";
	      } else {
	          document.getElementById("myBtn").style.display = "none";
	      }
	  }

	  // When the user clicks on the button, scroll to the top of the document
	  function topFunction() {
	      document.body.scrollTop = 0;
	      document.documentElement.scrollTop = 0;
	  }

		import commentBox from 'commentbox.io';
		// or
		const commentBox = require('commentbox.io');
		// or if using the CDN, it will be available as a global "commentBox" variable.

		commentBox('my-project-id');

	</script>

</body>


</html>
